# Generated by Django 4.2.13 on 2024-06-14 10:52

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('users', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Month',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('year', models.IntegerField()),
                ('month', models.IntegerField()),
                ('status', models.TextField(choices=[('approved', 'approved'), ('temporary', 'temporary'), ('not_approved', 'not_approved')], default='not_approved')),
            ],
            options={
                'db_table': 'month',
            },
        ),
        migrations.CreateModel(
            name='Procedure',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField(verbose_name='Название процедуры')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Описание процедуры')),
                ('duration', models.DurationField(verbose_name='Продолжительность процедуры')),
                ('min_research_count', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='Минимальное количество исследований')),
                ('max_research_count', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='Максимальное количество исследований')),
                ('price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Цена процедуры')),
                ('specialization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='procedures', to='users.specialization', verbose_name='Специализация')),
            ],
            options={
                'db_table': 'procedure',
            },
        ),
        migrations.CreateModel(
            name='PredictionFact',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('week', models.IntegerField()),
                ('qtty', models.IntegerField(blank=True, null=True)),
                ('qtty_predicted', models.IntegerField(blank=True, null=True)),
                ('month', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='weeks', to='service.month')),
                ('specialization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='specialization_fact', to='users.specialization')),
            ],
            options={
                'db_table': 'prediction_fact',
            },
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('kind', models.TextField(choices=[('work_time', 'work_time'), ('time_off', 'time_off'), ('sick', 'sick'), ('vacation', 'vacation'), ('work_delta', 'work_delta')])),
                ('day', models.IntegerField()),
                ('start_time', models.TimeField()),
                ('end_time', models.TimeField()),
                ('month', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to='service.month')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='events', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'event',
            },
        ),
    ]
